import request from '@/utils/request'

// 获取商品分类
export function cate(params) {
  return request({
    url: '/category',
    method: 'get',
    params
  })
}

// 新增商品分类
export function addCate(data) {
  return request({
    url: '/category',
    method: 'post',
    data
  })
}

// 删除商品分类
export function addDel(id) {
  return request({
    url: `/category/${id}`,
    method: 'delete'
  })
}

// 获取商品分类下的attrs
export function getCateAttrs(cid, type) {
  return request({
    url: `/category/${cid}`,
    method: 'get',
    params: {
      type
    }
  })
}

